import request from '@/utils/request'

// 获取API服务列表
export function getApiServiceList() {
  return request({
    url: '/noAuth/api/manage/list',
    method: 'get'
  })
}

// 获取API服务详情
export function getApiServiceDetail(id) {
  return request({
    url: `/noAuth/api/manage/${id}`,
    method: 'get'
  })
}

// 创建API服务
export function createApiService(data) {
  return request({
    url: '/noAuth/api/manage',
    method: 'post',
    data: data
  })
}

// 更新API服务
export function updateApiService(data) {
  return request({
    url: '/noAuth/api/manage',
    method: 'put',
    data: data
  })
}

// 删除API服务
export function deleteApiService(id) {
  return request({
    url: `/noAuth/api/manage/${id}`,
    method: 'delete'
  })
}

// 导出API对象
export const apiServiceAPI = {
  getApiServiceList,
  getApiServiceDetail,
  createApiService,
  updateApiService,
  deleteApiService
}

export default apiServiceAPI